<?php

namespace App\Transformers;
use League\Fractal\TransformerAbstract;
use Illuminate\Support\Str;
use App\Models\PlayerSource;

class PlayerSourceTransformer extends TransformerAbstract
{
    protected $availableIncludes = ['type'];
    public function transform(PlayerSource $player)
    {
        return [
            'name' => $player->type->name,
            'content' => $player->content,
            'url' => $player->url,
            'created_at' => (string) $player->created_at,
            'updated_at' => (string) $player->updated_at,
            'is_free' => $player->is_free,
            'is_vip_free' => $player->is_vip_free,
        ];
    }
}
